﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Projet1VideoAulaNery
{
    public partial class WebFormJavaScript : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Response.Redirect("http://www.unoparvirtual.com.br");
            //metodo Request
            Response.Write("Browser.:"+Request.UserAgent);
            Response.Write("</br>Url.:" + Request.Url);
            Response.Write("</br>UserHostName.:" + Request.UserHostName);
            Response.Write("</br>ApplicationPath.:" + Request.ApplicationPath);
            Response.Write("</br>HttpMethod.:" + Request.HttpMethod);

            Button3.Attributes.Add("onClick","javascript:return alert('Alerta via Attributes')");
            Button4.Attributes.Add("onClick", "javascript:return confirm('Confirma a gravação dos dados?')");
            Image1.Attributes.Add("onMouseOver", "alert('Evento onMouseOver da Imagem') ");

        }

        protected void Button5_Click(object sender, EventArgs e)
        {
            Response.Write("<script>alert('Mensagem do Response Write')</script>");
        }

        protected void Button6_Click(object sender, EventArgs e)
        {
            Response.Write("Mensagem Response Write");
        }

        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {

        }

        protected void Button7_Click(object sender, EventArgs e)
        {
            //Label1.Text = TextBox1.Text;
            //Label1.Text = "Request[TextBox1].:" + Request["TextBox1"];//pega informação de qualquer lugar
            Label1.Text = "Request[TextBox1].:" + Request.QueryString["TextBox1"]; //pega informação da url
            Label1.Text = "Request[TextBox1].:" + Request.Form["TextBox1"];//pega informação do form
        }
    }
}